package com.lovo.middleman.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lovo.middleman.bean.BuyBean;
import com.lovo.middleman.service.IBuyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/buy")
public class BuyController {

    @Autowired
    IBuyService iBuyService;

    @RequestMapping("/getBuyPage")
    public Page<BuyBean> getBuyPage(int curPage,
                                    int pageSize,
                                    String supplierName,
                                    String starTime,
                                    String endTime){
        return iBuyService.queryBuyBeanByItem(curPage,pageSize,supplierName,starTime,endTime);
    }

    @RequestMapping("/getBuyBean")
    public BuyBean getBuyBean(int buyId){
       return iBuyService.queryBuyBeanById(buyId);
    }
}
